package com.lmq.funcPro;

/**
 * Runnable interface has been in java since version 1.0
 * since no import is necessary.
 * It also conforms to the special single-method interface format:Its
 * method run() takes no arguments and has no return value. We can therefore use a lambda expr and a
 * method ref as a Runnable:
 */

class Go {
    static void go() {
        System.out.println("Go::go()");
    }
}



public class RunnableMethodReference {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            public void run(){
                System.out.println("aNONOYMOUS");
            }
        }).start();

        new Thread(
                () -> System.out.println("lambda")
        ).start();

        new Thread(Go::go).start();
    }
}
